execute visual/motion; syntax of doc window #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Paul,
I have made three changes:
The doc window gets "set syntax=rest" so that it can be colorized properly if the user has installed the rest syntax plugin (which isn't part of stock vim).
Ability to execute a block of python code selected visually, or via a motion command. I have mapped "<leader>p" for this purpose, although feel free to change that of course. "<leader>p" with code visually selected of course executes that visual selection. In normal mode, "<leader>p" acts as an operator which takes a motion. So for instance "\piw" executes the current word, "\pi)" executes stuff within parenthesis, "\pp" executes the current line, etc. This is useful for inspecting the value of a variable or half of an expression.
I have made some of the key mappings route through "<Plug>" mappings. So for instance, there is a mapping "<Plug>IPyRunLine" for running the current line. The advantage of doing it this way is that users are able to easily set up the key mappings however they want. See ":help using-<Plug>" for more info on this.